package xyz.zhno.factory.builder;

/**
 * 具体的构造者
 * @author zh_o
 * @date 2020-11-14
 */
public class Worker extends Builder {

    private Account account;

    public Worker() {
        this.account = new Account();
    }

    /**
     * 构造账户编号
     * @param accountNo 传入账户编号
     * @return 当前构造者
     */
    @Override
    Builder accountNo(String accountNo) {
        account.setAccountNo(accountNo);
        return this;
    }

    /**
     * 构造账户金额
     * @param amount 传入金额
     * @return 当前构造者
     */
    @Override
    Builder amount(Double amount) {
        account.setAmount(amount);
        return this;
    }

    /**
     * 获取账户对象
     * @return 账户对象
     */
    @Override
    Account getAccount() {
        return account;
    }
}
